﻿using System;
using System.Collections.Generic;
using System.Text;
using FileSystem.Services.IServices;
using FileSystem.Services.Realization;
using GalaSoft.MvvmLight.Ioc;

namespace FileSystem.ViewModels {
    /// <summary>
    /// ViewModel Locator
    /// </summary>
    public class ViewModelLocator {
        /// <summary>
        /// 初始化页ViewModel
        /// </summary>
        public InitializationPageViewModel InitializationPageViewModel =>
            SimpleIoc.Default.GetInstance<InitializationPageViewModel>();

        /// <summary>
        /// 桌面主页ViewModel
        /// </summary>
        public MainPageViewModel MainPageViewModel =>
            SimpleIoc.Default.GetInstance<MainPageViewModel>();

        /// <summary>
        /// 文件系统页ViewModel
        /// </summary>
        public FileSystemPageViewModel FileSystemPageViewModel =>
            SimpleIoc.Default.GetInstance<FileSystemPageViewModel>();

        /// <summary>
        /// 用户页ViewModel
        /// </summary>
        public UsersPageViewModel UsersPageViewModel =>
            SimpleIoc.Default.GetInstance<UsersPageViewModel>();

        /// <summary>
        /// 添加用户页ViewModel
        /// </summary>
        public AddUserPageViewModel AddUserPageViewModel =>
            SimpleIoc.Default.GetInstance<AddUserPageViewModel>();

        /// <summary>
        /// 编辑用户信息页ViewModel
        /// </summary>
        public EditUserPageViewModel EditUserPageViewModel =>
            SimpleIoc.Default.GetInstance<EditUserPageViewModel>();

        /// <summary>
        /// 登录页面ViewModel
        /// </summary>
        public LoginPageViewModel LoginPageViewModel =>
            SimpleIoc.Default.GetInstance<LoginPageViewModel>();

        /// <summary>
        /// 物理磁盘块页ViewModel
        /// </summary>
        public PhysicalDiskBlockPageViewModel PhysicalDiskBlockPageViewModel =>
            SimpleIoc.Default.GetInstance<PhysicalDiskBlockPageViewModel>();

        /// <summary>
        /// 纸张页ViewModel
        /// </summary>
        public PaperPageViewModel PaperPageViewModel =>
            SimpleIoc.Default.GetInstance<PaperPageViewModel>();

        /// <summary>
        /// ViewModel Locator
        /// </summary>
        public ViewModelLocator() {
            SimpleIoc.Default.Register<IRootPageActivationService,RootPageActivationService>();
            SimpleIoc.Default.Register<IRootNavigationService,RootNavigationService>();
            SimpleIoc.Default
                .Register<IContentPageActivationService,
                    ContentPageActivationService>();
            SimpleIoc.Default
                .Register<IContentNavigationService, ContentNavigationService
                >();
            SimpleIoc.Default.Register<IRootDirItemStorage,RootDirItemStorage>();
            SimpleIoc.Default.Register<IPreferenceStorage,PreferenceStorage>();
            SimpleIoc.Default.Register<ISystem,Services.Realization.System>();
            SimpleIoc.Default.Register<IRootDirItemStorage,RootDirItemStorage>();
            SimpleIoc.Default.Register<IDirItemStorage,DirItemStorage>();
            SimpleIoc.Default.Register<IUserStorage,UserStorage>();
            SimpleIoc.Default.Register<IPhysicalDiskBlockStorage,PhysicalDiskBlockStorage>();
            SimpleIoc.Default.Register<IDiskBlockStorage,DiskBlockStorage>();
            SimpleIoc.Default.Register<IAccessControlInfoStorage,AccessControlInfoStorage>();
            SimpleIoc.Default.Register<InitializationPageViewModel>();
            SimpleIoc.Default.Register<MainPageViewModel>();
            SimpleIoc.Default.Register<FileSystemPageViewModel>();
            SimpleIoc.Default.Register<UsersPageViewModel>();
            SimpleIoc.Default.Register<AddUserPageViewModel>();
            SimpleIoc.Default.Register<EditUserPageViewModel>();
            SimpleIoc.Default.Register<LoginPageViewModel>();
            SimpleIoc.Default.Register<PhysicalDiskBlockPageViewModel>();
            SimpleIoc.Default.Register<PaperPageViewModel>();
        }
    }
}